#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from search.mongo import *
from search.setting import *

reload(sys)
sys.setdefaultencoding( "utf-8" )
db = MongoDb()
db.clear()
for k in searchitems:
    sort = k
    items = searchitems[k]
    for p in items:
        item = items[p]
        item['sort'] = k
        item['name'] = p
        if not item.has_key('text'):
           item['text'] = p
        if not item.has_key('isShow'):
            item['isShow'] = False
        if not item.has_key('filterType'):
            item['filterType'] = 1
        db.save(item)